package com.qd.panda.service.third.dc.dto;

import com.cdqidi.valid.group.DefaultGroup;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * @author sjk
 */
@Data
@Accessors(chain = true)
public class OrderReqDTO {
    /**
     * 第三方订单ID
     */
    @NotBlank(message = "第三方订单ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "第三方订单ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String thirdPartyOrderId;
    /**
     * 产品编号
     */
    @NotBlank(message = "产品编号不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "产品编号长度不能超过{max}位", groups = DefaultGroup.class)
    private String commodityId;
    /**
     * 商品价格
     */
    @NotNull(message = "商品价格不能为空", groups = DefaultGroup.class)
    private BigDecimal commodityPrice;
    /**
     * 充值账号
     */
    @NotBlank(message = "充值账号不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "充值账号长度不能超过{max}位", groups = DefaultGroup.class)
    private String rechargeAccount;
    /**
     * 充值量:金额或者数量
     */
    @NotNull(message = "充值量不能为空", groups = DefaultGroup.class)
    private BigDecimal rechargeValue;
    /**
     * 用户支付金额
     */
    @NotNull(message = "充值量不能为空", groups = DefaultGroup.class)
    private BigDecimal payAmount;
    /**
     * 用户IP，长度15
     */
    private String customerIp;
    /**
     * 下单时间
     */
    @NotBlank(message = "下单时间不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "下单时间长度不能超过{max}位", groups = DefaultGroup.class)
    private String orderTime;
    /**
     * 小程序ID
     */
    @NotBlank(message = "小程序ID不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "小程序ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String appId;
    /**
     * 微信用户标识
     */
    @NotBlank(message = "微信用户标识不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "微信用户标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String openid;
    /**
     * 用户ID
     */
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "手机号长度不能超过{max}位", groups = DefaultGroup.class)
    private String mobile;
    /**
     * 同步组织编码
     */
    @NotBlank(message = "同步组织不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "同步组织长度不能超过{max}位", groups = DefaultGroup.class)
    private String syncConfigCode;

    public void freeData(){
        this.thirdPartyOrderId = null;
        this.commodityId = null;
        this.commodityPrice = null;
        this.rechargeAccount = null;
        this.rechargeValue = null;
        this.payAmount = null;
        this.customerIp = null;
        this.orderTime = null;
        this.appId = null;
        this.openid = null;
        this.userId = null;
        this.mobile = null;
        this.syncConfigCode = null;
    }
}
